﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AdministratorSite.Master" Inherits="System.Web.Mvc.ViewPage<Cs2102BookingSystem.Models.CLIENT>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	CreateClient
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script runat="server">
    public void printError(string error_for)
    {
        if(ViewData[error_for]!=null)
        {
            Response.Write(ViewData[error_for]);
        }
    }
    </script>
    <asp:Panel ID="Panel2" runat="server" Height="61px" 
        style="font-size: xx-large; font-weight: 700; font-family: Calibri">
        <b>Search Client</b></asp:Panel>

    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>
            <fieldset>
            <legend>Client Information</legend>
            <table>
                <tr>
                    <td colspan="5" style="color:Red"><% printError("ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red">*</td>
                    <td style="width: 150px" colspan="2"><label for="EMAIL">Email</label></td>
                    <td >
                        <%: Html.TextBoxFor(model => model.EMAIL) %>
                    </td>
                    <td style="color:Red"><% printError("EMAIL_ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red">*</td>
                    <td style="width: 150px" colspan="2"><label for="PWD">Password</label></td>
                    <td>                
                    <%: Html.PasswordFor(model => model.PWD) %>
                    </td>
                    <td style="color:Red"><% printError("PWD_ERROR"); %></td>
                </tr>
               <tr>
                   <td style="color:Red">*</td>
                   <td></td>
                   <td><label for="FIRSTNAME">First Name</label></td>
                   <td><label for="LASTNAME">Last Name</label></td>
               </tr>
               <tr>
                   <td style="color:Red"></td>
                   <td>
                    <%: Html.DropDownListFor(model => model.DESIGNATION, new[] {
                                                                                new SelectListItem { Value = "Mr", Text = "Mr" },
                                                                                new SelectListItem { Value = "Ms", Text = "Ms" },
                                                                                new SelectListItem { Value = "Miss", Text = "Miss" },
                                                                                new SelectListItem { Value = "Dr.", Text = "Dr." },
                                                                               }
                                                                                    
                                             )%>
                    </td>
                    <td>
                        <%: Html.TextBoxFor(model => model.FIRSTNAME) %>
                    </td>
                    <td>
                        <%: Html.TextBoxFor(model => model.LASTNAME) %>
                    </td>    
                   <td style="color:Red">
                       <% printError("DESIGNATION_ERROR"); %> <br />
                       <% printError("FIRSTNAME_ERROR"); %> <br />
                       <% printError("LASTNAME_ERROR"); %>
                   </td>
                </tr>
                <tr>
                    <td style="color:Red">*</td>
                    <td style="width: 150px" colspan="2"><label for="PASSPORTNO">NRIC / Passport Number</label></td>
                    <td>                
                        <%: Html.TextBoxFor(model => model.PASSPORTNO) %>
                    </td>
                    <td style="color:Red"><% printError("PASSPORTNO_ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red">*</td>
                    <td style="width: 150px" colspan="2"><label for="CONTACT">Contact</label>
                    </td>
                    <td>                
                        <%: Html.TextBoxFor(model => model.CONTACT) %>
                    </td>
                    <td style="color:Red"><% printError("CONTACT_ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red">*</td>
                    <td style="width: 150px" colspan="2"><label for="GENDER">Gender</label></td>
                    <td>
                        <label for="M_GENDER">Male</label>
                        <%: Html.RadioButtonFor(model => model.GENDER, "M", new Dictionary<string, object> { { "id", "M_GENDER" } })%> 
                        <label for="F_GENDER">Female</label>
                        <%: Html.RadioButtonFor(model => model.GENDER, "F", new Dictionary<string, object> { { "id", "F_GENDER" } }) %>
                    </td>
                    <td style="color:Red"><% printError("GENDER_ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red">*</td>
                    <td style="width: 150px" colspan="2"><label for="ADDRESS">Address</label></td>
                    <td>                
                        <%: Html.TextBoxFor(model => model.ADDRESS) %>
                    </td>
                    <td style="color:Red"><% printError("ADDRESS_ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red">*</td>
                    <td style="width: 150px" colspan="2"><label for="COUNTRY">Country</label></td>
                    <td>                
                        <%: Html.TextBoxFor(model => model.COUNTRY)%>
                    </td>
                    <td style="color:Red"><% printError("COUNTRY_ERROR"); %></td>
                </tr>
                <tr>
                    <td style="color:Red">*</td>
                    <td style="width: 150px" colspan="2"><label for="ACCOUNTSTATUS">Account Type</label></td>
                    <td>
                        <%: Html.DropDownListFor(model => model.ACCOUNTSTATUS, new SelectList(new [] { "admin", "member" } ))%>
                    </td>
                    <td style="color:Red"><% printError("ACCOUNTSTATUS_ERROR"); %></td>
                </tr>
                <tr style="height:50px">
                    <td colspan="3" style="color:Red">* indicates required fields</td>
                </tr>
                <tr>
                    <td colspan="4"><input type="submit" value="Create" /></td>
                </tr>
            </table>
        </fieldset>
    <% } %>

    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>

</asp:Content>

